Conversation
d25c76c to
e0d5b31
Compare
There was a problem hiding this comment.
Pull Request Overview
This pull request enhances documentation clarity by introducing LaTeX formatting to doc comments and adding KaTeX support for HTML-rendered docs.
- Updated transformation documentation in swiftnav/src/reference_frame/mod.rs with LaTeX equations
- Reformatted the CRC polynomial in swiftnav/src/edc.rs and coordinate conversion formulas in swiftnav/src/coords.rs
- Configured Cargo.toml and added katex-header.html to support math rendering on docs.rs
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| swiftnav/src/reference_frame/mod.rs | Updated doc comments for Helmert transformation with LaTeX formatting |
| swiftnav/src/edc.rs | Reformatted CRC polynomial comment using LaTeX delimiters |
| swiftnav/src/coords.rs | Updated coordinate conversion formulas to use LaTeX notation |
| swiftnav/Cargo.toml | Added docs.rs metadata for KaTeX header inclusion |
| katex-header.html | Added KaTeX header with required CSS and JS includes |
Comments suppressed due to low confidence (1)
swiftnav/src/reference_frame/mod.rs:144
- The word 'tranformation' appears to be misspelled; it should be 'transformation'.
/// 3 dimensional rotation, and a universal scaling. The tranformation takes the form of:
pcrumley
left a comment
There was a problem hiding this comment.
LGTM. I dont quite understand the change of the description of the helmert transform and I don't know if they are equivalent e.g. 7 parameters vs 15
swiftnav/Cargo.toml
Outdated
| # This tells docs.rs to include the katex header for math formatting | ||
| # To do this locally | ||
| [package.metadata.docs.rs] | ||
| rustdoc-args = [ "--html-in-header", "katex-header.html" ] No newline at end of file |
| {left: "$$", right: "$$", display: true}, | ||
| {left: "\\(", right: "\\)", display: false}, | ||
| {left: "$", right: "$", display: false}, | ||
| {left: "\\[", right: "\\]", display: true} |
There was a problem hiding this comment.
How do overlapping rules work here? Would the
{left: "$", right: "$", display: false}
supersede the
{left: "$$", right: "$$", display: true}
There was a problem hiding this comment.
I'm not entirely sure, this was some boiler plate from the Katex crate. Looking at the original Katex docs it looks like ordering here does matter, and this is the correct ordering to allow $$ to take precedence over $.
There are a few places where a bit of LaTeX would help make things a bit more clear in our documentation. Indeed the C library documentation has several uses of LaTeX which Doxygen handles. This is based on the rustdoc-katex-demo crate, which demonstates how to include a link to the KaTex code in the HTML generated for the documents.
Example
The coord documentation has been changed from this



to
And the helmert transformation docs is now hopefully a bit more clear with the transformation formula fully displayed